const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('as4KDotsTc', {
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "编号"
    },
    create_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: Sequelize.Sequelize.fn('now'),
      comment: "创建时间"
    },
    update_time: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
      comment: "更新时间"
    },
    secucode: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "代码"
    },
    security_code: {
      type: DataTypes.STRING(6),
      allowNull: true,
      comment: "数字代码"
    },
    security_name_abbr: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "名称"
    },
    new_board_code: {
      type: DataTypes.STRING(20),
      allowNull: true
    },
    board_name: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "题材"
    },
    selected_board_reason: {
      type: DataTypes.STRING(1000),
      allowNull: true,
      comment: "入选原因"
    }
  }, {
    sequelize,
    tableName: 'as4k_dots_tc',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
      {
        name: "com_tc_secucode_index",
        using: "BTREE",
        fields: [
          { name: "secucode" },
        ]
      },
      {
        name: "com_tc_security_code_index",
        using: "BTREE",
        fields: [
          { name: "security_code" },
        ]
      },
      {
        name: "index_name",
        using: "BTREE",
        fields: [
          { name: "security_name_abbr" },
        ]
      },
    ]
  });
};
